using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class LeveSelect : MonoBehaviour
{

    //public GameObject levelSelectPanel;
    //Button[] levelSelectButtons;
    //int unlockedLevelIndex;
    // Start is called before the first frame update
    //private void Awake()
    //{
    //    Date.Intance.LevelSelect = new bool[levelSelectPanel.transform.childCount];
    //    
    //   


    //}
    void Start()
    {
        //Debug.Log(Date.Intance.LevelSelect[2]);
        //unlockedLevelIndex = PlayerPrefs.GetInt("unlockedLevelIndex");
        //levelSelectButtons = new Button[levelSelectPanel.transform.childCount];
        //for (int i = 0; i < levelSelectPanel.transform.childCount; i++)
        //{
        //    levelSelectButtons[i] = levelSelectPanel.transform.GetChild(i).GetComponent<Button>();
        //}
        //for (int i = 0; i < levelSelectButtons.Length; i++)
        //{
        //    levelSelectButtons[i].interactable = false;

        //}
        //for (int i = 0; i < unlockedLevelIndex + 1; i++)
        //{
        //    levelSelectButtons[i].interactable = true;

        //}
    }

    // Update is called once per frame
    void Update()
    {
        //unlockedLevelIndex = PlayerPrefs.GetInt("unlockedLevelIndex");

        //if (Date.Intance.LevelSelect !=null)
        //{

        //    for (int i = 0; i < Date.Intance.LevelSelect.Length; i++)
        //    {
        //        if (Date.Intance.LevelSelect[i] == true)
        //        {
        //            Debug.Log(i);
        //            levelSelectButtons[i].interactable = true;
        //        }
        //    }
        //}
            
        
    }

    public void MainMenu()
    {
        SceneManager.LoadScene("MainMenu");
        
    }
    public void level_0()
    {
        SceneManager.LoadScene(1);
        
    }

    public void level_1()
    {
        SceneManager.LoadScene(2);
       
    }

  
}
